package com.bw.android.bwgao6week2a;

import com.bw.android.network.bean.LoginBean;

/**
 * Author: conghao
 * Date: 2023/9/18 16:03
 * Description: App单例
 */
public class AppInstance {
    public static final String TAG = "LookFor";
    private static volatile AppInstance mInstance;
    private AppInstance() {

    }
    public static AppInstance getInstance() {
        if (mInstance == null) {
            synchronized (AppInstance.class) {
                if (mInstance == null) {
                    mInstance = new AppInstance();
                }
            }
        }
        return mInstance;
    }

    /**
     * 保存登录成功后的数据
     */
    public LoginBean.ResultBean loginResultBean;

    public int getUserId() {
        if (loginResultBean == null) return 0;
        else return loginResultBean.getUserId();
    }
}
